package players;

import java.util.Random;
import staticClasses.*;


public class GoalKeeper extends Player{
	
	public GoalKeeper(Square init) {
		super(init);
	}

	@Override
	public void setLevel(PlayerLevel level){
		
		this.globalLevel = level;
		Random rand = new Random();
		
		switch(level){
			case EASY:
				this.behavior=new GoalBehavior(this);
				this.dribble_level		= (short)(Global.baseGoalStats[0] + Global.EASYadjust + rand.nextInt(50) - 25);
				this.speed				= (short)(Global.baseGoalStats[1] + Global.EASYadjust + rand.nextInt(50) - 25);
				this.power				= (short)(Global.baseGoalStats[2] + Global.EASYadjust + rand.nextInt(50) - 25);
				this.intercept_level	= (short)(Global.baseGoalStats[3] + Global.EASYadjust + rand.nextInt(50) - 25);
				this.accuracy			= (short)(Global.baseGoalStats[4] + Global.EASYadjust + rand.nextInt(50) - 25);
				this.stamina			= (short)(Global.baseGoalStats[5] + Global.EASYadjust + rand.nextInt(50) - 25);
				break;
			case MEDIUM:
				this.behavior=new GoalBehavior(this);
				this.dribble_level		= (short)(Global.baseGoalStats[0] + rand.nextInt(50) - 25);
				this.speed				= (short)(Global.baseGoalStats[1] + rand.nextInt(50) - 25);
				this.power				= (short)(Global.baseGoalStats[2] + rand.nextInt(50) - 25);
				this.intercept_level	= (short)(Global.baseGoalStats[3] + rand.nextInt(50) - 25);
				this.accuracy			= (short)(Global.baseGoalStats[4] + rand.nextInt(50) - 25);
				this.stamina			= (short)(Global.baseGoalStats[5] + rand.nextInt(50) - 25);
				break;
			case HARD:
				this.behavior=new GoalBehavior(this);
				this.dribble_level		= (short)(Global.baseGoalStats[0] + Global.HARDadjust + rand.nextInt(50) - 25);
				this.speed				= (short)(Global.baseGoalStats[1] + Global.HARDadjust + rand.nextInt(50) - 25);
				this.power				= (short)(Global.baseGoalStats[2] + Global.HARDadjust + rand.nextInt(50) - 25);
				this.intercept_level	= (short)(Global.baseGoalStats[3] + Global.HARDadjust + rand.nextInt(50) - 25);
				this.accuracy			= (short)(Global.baseGoalStats[4] + Global.HARDadjust + rand.nextInt(50) - 25);
				this.stamina			= (short)(Global.baseGoalStats[5] + Global.HARDadjust + rand.nextInt(50) - 25);
				break;
		}
		if(this.dribble_level<0){this.dribble_level=0;}else if(this.dribble_level>255){this.dribble_level=255;}
		if(this.speed<0){this.speed=0;}else if(this.speed>255){this.speed=255;}
		if(this.power<0){this.power=0;}else if(this.power>255){this.power=255;}
		if(this.intercept_level<0){this.intercept_level=0;}else if(this.intercept_level>255){this.intercept_level=255;}
		if(this.accuracy<0){this.accuracy=0;}else if(this.accuracy>255){this.accuracy=255;}
		if(this.stamina<0){this.stamina=0;}else if(this.stamina>255){this.stamina=255;}
	}
	
}
